import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { QuestionType } from '../../shared/model/question.model';

@Component({
  moduleId: module.id,
  selector: 'app-question-select',
  templateUrl: './question-select.component.html',
  styleUrls: ['./question-select.component.scss']
})
export class QuestionSelectComponent implements OnInit {
  @Output()
  addQustionRequest = new EventEmitter();

  private controls: any[];

  constructor() {
    this.controls = [
      {
        type: QuestionType.Text,
        label: '文本问题',
        iconClass: 'icon-text'
      },
      {
        type: QuestionType.SingleSelect,
        label: '单选问题',
        iconClass: 'icon-radio'
      },
      {
        type: QuestionType.MultiSelect,
        label: '多选问题',
        iconClass: 'icon-checkbox'
      },
      {
        type: QuestionType.Score,
        label: '分值问题',
        iconClass: 'icon-star'
      },

    ];
  }
  onAddQuestion(control: any) {
    console.log(control);
    this.addQustionRequest.emit(control.type);
  }
  ngOnInit() {
  }

}
